package cn.keniykey.mc.landterritory.event;

import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.event.Cancellable;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;

import cn.keniykey.mc.landterritory.land.api.LandRange;

public final class LandCreateEvent extends Event implements Cancellable{
	private static final HandlerList handlers = new HandlerList();
	
	@Override
	public HandlerList getHandlers() {
		return handlers;
	}
	public static HandlerList getHandlerList() {
		return handlers;
	}
	
	private boolean cancel = false;
	
	@Override
	public boolean isCancelled() {
		return this.cancel;
	}
	@Override
	public void setCancelled(boolean cancel) {
		this.cancel = cancel;
	}
	
	private final Player player;
	private final LandRange range;
	private final String name;
	
	public LandCreateEvent(Player player,LandRange range,String name) {
		super(!Bukkit.isPrimaryThread());
		this.player = player;
		this.range = range;
		this.name = name;
	}
	
	public Player getPlayer() {
		return this.player;
	}
	public LandRange getRange() {
		return this.range;
	}
	public String getLandName() {
		return this.name;
	}
}